pkgname=maa-cli-arm64
pkgver=5.15.0
pkgrel=1
pkgdesc="MAA Command Line Interface for arm64"
arch=('aarch64')
url="https://github.com/MaaAssistantArknights/maa-cli"
license=('AGPL3')
depends=('gcc' 'gcc-libs' 'git' 'libgit2' 'openssl' 'cargo')
source=("https://github.com/MaaAssistantArknights/maa-cli/releases/latest/download/maacli-aarch64-unknown-linux-gnu.tar.gz")
sha256sums=('SKIP') # 请替换为实际的 SHA256 校验和

prepare() {
  # 解压源码
  tar -xzf "$srcdir/maacli-aarch64-unknown-linux-gnu.tar.gz" -C "$srcdir"
}

build() {
  # 由于是二进制分发，这里可能不需要构建步骤
  true
}

package() {
  # 定义安装路径
  local _install_dir="/usr/bin"
  
  # 复制文件到安装路径
  cp -a "$srcdir/maacli-aarch64-unknown-linux-gnu/." "$pkgdir$_install_dir/"
  
  # 设置执行权限
  chmod +x "$pkgdir$_install_dir/maa"
}

post_install() {
  # 运行 maa install
  "$pkgdir/usr/bin/maa" install
  
  # 运行 maa update
  "$pkgdir/usr/bin/maa" update
}


